package com.recharge.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.recharge.services.rechargemodel;
import com.recharge.view.rechargeview;

public class rechargeaction extends Action {
	rechargemodel rm=new rechargemodel();
	public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response)
	{
		ActionForward forword=null;
		rechargeview rv=(rechargeview)form;
		String user=rv.getUsername();
		String pass=rv.getPassword();
		boolean flag=rm.isAuthencaticated(user, pass);
		if(flag)
		{
			forword=mapping.findForward("success");
			
		}
		else{
			forword=mapping.findForward("failure");
		}
		return forword;
	}

}
